1. Field of Invention
The present invention relates to a computer system. More particularly, the present invention relates to a publishing/subscription system to dynamically change publishing priorities of data messages according to data message chains.
2. Description of Related Art
Publishing/subscription systems, which transmit data messages from publishing computers to subscribing computers through the Internet, have become very popular. In detail, publishing/subscription systems are asynchronous messaging systems where publishing computers are not programmed to send their data messages to specific subscribing computers. Rather, published data messages are characterized into classes and transmitted to a data message broker, without knowledge of what (if any) subscribing computers there may be. The data message broker publishes the published data messages to the subscribing computers that subscribe the characterized classes.
Data message transmissions of publishing/subscription systems are mainly implemented by first-in-first-out (FIFO). FIG. 1 is a block diagram showing a conventional publishing/subscription system implemented by FIFO. Refer to FIG. 1. The system comprises a publishing application 102, a data message broker 104, and a subscribing application 106. The publishing application 102 and the subscribing application 106 refer to software programs running on computers. The data message broker 104 is implemented by FIFO. Therefore, the data message broker 104 publishes data messages according to time sequence. For example, the publishing application 102 publishes data messages m1, m2, and m3 sequentially to the data message broker 104. Then, according to the time sequence, the message broker 104 publishes the data messages m1, m2, and m3 sequentially to the subscribing application 106. However, when the data message m2 is urgent, the data message m2 is still published after the data message m1. As the increasing number of data messages, FIFO may delay some urgent data messages.
To improve FIFO, Dynamic Priority Scheduling is disclosed. FIG. 2 is a block diagram showing a conventional publishing/subscription system implemented by Dynamic Priority Scheduling. Refer to FIG. 2. The system comprises a publishing application 102, a data message broker 204, and a subscribing application 106. The publishing application 102 and the subscribing application 106 refer to software programs running on computers. The data message broker 204 is implemented by Dynamic Priority Scheduling. Therefore, the data message broker 204 publishes data messages according to priorities. For example, the publishing application 102 publishes data messages n1, n2, and n3, wherein the data message n2 is urgent. Since the data message n2 is urgent, the data message broker 204 sets priority of the data message n2 as Pn2=3, wherein priority=3 means high priority. Since the data messages n1 and n3 are general data messages, the data message broker 204 respectively sets priorities of the data messages n1 and n3 as Pn1=1 and Pn3=1, wherein priority=1 means low priority. Therefore, according to the priority, the data message broker 204 may publish the data messages n2, n1, and n3 sequentially. However, relations between data messages are ignored. For example, the data message n3 is related to the urgent data message n2, but Pn3 is just set to 1, which means that the data message n3 can't be published in time to support the urgent data message n2.
Therefore, what is needed is a method and a system to publish a data message according to the priority of the data message. Wherein the priority is set according to contents of both the data message and related data messages of the data message. Hence, subscribers can receive urgent data messages and those data messages related to the urgent data messages. In addition, as increasing number of data messages, the subscribers can deal with data messages properly according to priority value.